<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName" value="${message(code: 'financialPledge.label', default: 'FinancialPledge')}"/>
    <title>新增债券</title>
</head>

<body>
<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right">
                <ol class="hbreadcrumb breadcrumb">
                    <li>PLS CINDATA</li>
                    <li>
                        <g:link controller="menu" action="index">CINDATA</g:link>
                    </li>
                    <li class="active">
                        <span>新增债券</span>
                    </li>
                </ol>
            </div>

            <h2 class="font-light m-b-xs">
                新增债券
            </h2>
        </div>
    </div>
</div>

<g:form action="save">
    <g:if test="${flash.message}">
        <div class="message alert alert-info" role="status">${flash.message}</div>
    </g:if>
    <g:hasErrors bean="${this.menu}">
        <ul class="errors" role="alert">
            <g:eachError bean="${this.menu}" var="error">
                <li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message
                        error="${error}"/></li>
            </g:eachError>
        </ul>
    </g:hasErrors>

    <div class="content animate-panel">
        <div class="row">
            <div class="hpanel hred">
                <div class="panel-heading">
                    关联贷款信息
                </div>
                <div class="panel-body form-horizontal">
                    <div class="form-group">
                        <label class="col-md-2 control-label is-required">贷款</label>
                        <div class="col-md-3">
                            <g:select class="form-control m-b" multiple="multiple" name="mortgageList" id="mortgageList" from="${com.cindata.Mortgage.list(max: 1000)}" optionValue="serialNumber" optionKey="id" value="${this?.vehicle?.mortgage?.id}" noSelection="${['': '请选择贷款']}"/>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <div class="content animate-panel">
        <div class="row">
            <div class="hpanel hblue">
                <div class="panel-heading">
                    债券基本信息
                </div>

                <div class="panel-body form-horizontal">

                    <div class="form-group">

                        <label class="col-md-2 control-label is-required">省份</label>
                        <div class="col-md-3">
                            <g:select class="form-control m-b" name="province" id="province" from="${com.cindata.Province.list()}" optionValue="name" optionKey="id" value="${this?.financialPledge?.province?.id}" noSelection="${['': '请选择省份']}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label is-required">押品状态</label>
                        <div class="col-md-3">
                            <g:select class="form-control m-b" name="estateStatus" id="estateStatus" from="${com.cindata.dictionary.EstateStatusDict.list()}" optionValue="name" optionKey="id" value="${this?.financialPledge?.estateStatus?.id}" noSelection="${['': '请选择押品状态']}"/>
                        </div>

                        <label class="col-md-2 control-label is-required">城市</label>
                        <div class="col-md-3">
                            <g:select class="form-control m-b" name="city" id="city" from="${com.cindata.City.findAllByNameInList(new com.cindata.ComponentService().evaluate(com.cindata.Component.findByCode('showCity')), [sort: 'name', order: 'asc'])}" optionValue="name" optionKey="id" value="${this?.financialPledge?.city?.id}" noSelection="${['': '请选择市']}"/>
                        </div>
                        
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label is-required">是否在押</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="isEstate" id="isEstate" value="${this.financialPledge?.isEstate}"/>
                        </div>

                        <label class="col-md-2 control-label is-required">区域</label>
                        <div class="col-md-3">
                            <g:select class="form-control m-b" name="district" id="district" from="${com.cindata.District.list()}" optionValue="name" optionKey="id" value="${this?.financialPledge?.district?.id}" noSelection="${['': '请选择区域']}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label is-required">评估单价</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="unitPrice" id="unitPrice" value="${this.financialPledge?.unitPrice}"/>
                        </div>

                        <label class="col-md-2 control-label is-required">评估总价</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="totalPrice" id="totalPrice" value="${this.financialPledge?.totalPrice}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label is-required">评估时间</label>
                        <div class="col-md-3">
                            <g:datePicker class="form-control" name="valuationDate" value="${new Date()}" precision="day"/>
                        </div>

                        <label class="col-md-2 control-label is-required">抵押率 （%）</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="ltv" id="ltv" value="${this.financialPledge?.ltv}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label is-required">直属管理机构</label>
                        <div class="col-md-3">
                            <g:select class="form-control m-b" name="account" id="account" from="${com.cindata.Account.findAllByType(com.cindata.dictionary.AccountTypeDict.BANK())}" optionValue="name" optionKey="id" value="${this?.financialPledge?.account?.id}" noSelection="${['': '请选择直属管理机构']}"/>
                        </div>

                        <label class="col-md-2 control-label is-required">动态抵押率 （%）</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="cltv" id="cltv" value="${this.financialPledge?.cltv}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label is-required">贷款状态</label>
                        <div class="col-md-3">
                            <g:select class="form-control m-b" name="mortgageStatus" id="mortgageStatus" from="${com.cindata.dictionary.MortgageStatusDict.list()}" optionValue="name" optionKey="id" value="${this?.financialPledge?.mortgageStatus?.id}" noSelection="${['': '请选择贷款状态']}"/>
                        </div>
                    </div>                    
                </div>
            </div>
        </div>
    </div>

    <div class="content animate-panel">
        <div class="row">
            <div class="hpanel hyellow">
                <div class="panel-heading">
                    债券主体信息
                </div>

                <div class="panel-body form-horizontal">

                    <div class="form-group">
                        <label class="col-md-2 control-label is-required">质押物编号</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="externalId" id="externalId" value="${this.financialPledge?.externalId}"/>
                        </div>
                        <label class="col-md-2 control-label">质押物类型</label>
                        <div class="col-md-3">
                            <g:select class="form-control m-b" name="type" id="type" from="${com.cindata.dictionary.FinancialPledgeTypeDict.list()}" optionValue="name" optionKey="id" value="${com.cindata.dictionary.FinancialPledgeTypeDict.findByName('债券')?.id}" noSelection="${['': '请选择贷款']}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">质押物名称</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="name" id="name" value="${this.financialPledge?.name}"/>
                        </div>

                        <label class="col-md-2 control-label">凭证号码</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="number" id="number" value="${this.financialPledge?.number}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">出质人名称</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="fullName" id="fullName" value="${this.financialPledge?.fullName}"/>
                        </div>

                        <label class="col-md-2 control-label">出质人证件类型</label>
                        <div class="col-md-3">
                            <g:select class="form-control m-b" name="identityType" id="identityType" from="${com.cindata.dictionary.ContactIdentityType.list()}" optionValue="name" optionKey="id" value="${this?.financialPledge?.identityType?.id}" noSelection="${['': '请选择证件类型']}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">出质人贷款卡编号</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="loanCardNumber" id="loanCardNumber" value="${this.financialPledge?.loanCardNumber}"/>
                        </div>

                        <label class="col-md-2 control-label">出质人证件号码</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="idNumber" id="idNumber" value="${this.financialPledge?.idNumber}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">其他共同所有人</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="commonOwnerFullName" id="commonOwnerFullName" value="${this.financialPledge?.commonOwnerFullName}"/>
                        </div>

                        <label class="col-md-2 control-label">所占份额</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="sharePoint" id="sharePoint" value="${this.financialPledge?.sharePoint}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">债券发行单位</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="issuer" id="issuer" value="${this.financialPledge?.issuer}"/>
                        </div>

                        <label class="col-md-2 control-label">发行机构类型</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="issuerType" id="issuerType" value="${this.financialPledge?.issuerType}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">债券代理发行机构</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="agency" id="agency" value="${this.financialPledge?.agency}"/>
                        </div>

                        <label class="col-md-2 control-label">是否为收购国有银行不良贷款而定向发行的债券</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="isOrienteeringBond" id="isOrienteeringBond" value="${this.financialPledge?.isOrienteeringBond}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">债券代码</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="code" id="code" value="${this.financialPledge?.code}"/>
                        </div>

                        <label class="col-md-2 control-label">债券数量</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="bondAmount" id="bondAmount" value="${this.financialPledge?.bondAmount}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">是否记名债券</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="isRegisteredBond" id="isRegisteredBond" value="${this.financialPledge?.isRegisteredBond}"/>
                        </div>

                        <label class="col-md-2 control-label">是否需要办理止付</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="isNeedStopPayment" id="isNeedStopPayment" value="${this.financialPledge?.isNeedStopPayment}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">债券年利率</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="rate" id="rate" value="${this.financialPledge?.rate}"/>
                        </div>

                        <label class="col-md-2 control-label">债券收益类型</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="incomeType" id="incomeType" value="${this.financialPledge?.incomeType}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">债券计息方式</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="chargeInterestMethod" id="chargeInterestMethod" value="${this.financialPledge?.chargeInterestMethod}"/>
                        </div>

                        <label class="col-md-2 control-label">债券评级</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="level" id="level" value="${this.financialPledge?.level}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">债券发行日</label>
                        <div class="col-md-3">
                            <g:datePicker class="form-control" name="startDate" value="${new Date()}" precision="day"/>
                        </div>

                        <label class="col-md-2 control-label">债券到期日期</label>
                        <div class="col-md-3">
                            <g:datePicker class="form-control" name="endDate" value="${new Date()}" precision="day"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">债券期限</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="duration" id="duration" value="${this.financialPledge?.duration}"/>
                        </div>

                        <label class="col-md-2 control-label">债券金额</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="amount" id="amount" value="${this.financialPledge?.amount}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">质押登记机构</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="pledgeRegistrationAgency" id="pledgeRegistrationAgency" value="${this.financialPledge?.pledgeRegistrationAgency}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">币种</label>
                        <div class="col-md-3">
                            <g:select class="form-control m-b" name="currency" id="currency" from="${com.cindata.dictionary.CurrencyDict.list()}" optionValue="name" optionKey="id" value="${this?.financialPledge?.currency?.id}" noSelection="${['': '请选择币种']}"/>
                        </div>

                        <label class="col-md-2 control-label">变现能力</label>
                        <div class="col-md-3">
                            <g:select class="form-control m-b" name="cashability" id="cashability" from="${com.cindata.dictionary.Cashability.list()}" optionValue="name" optionKey="id" value="${this?.financialPledge?.cashability?.id}" noSelection="${['': '请选择变现能力']}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">价值波动性</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="valueVolatility" id="valueVolatility" value="${this.financialPledge?.valueVolatility}"/>
                        </div>

                        <label class="col-md-2 control-label">查封便利性</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="seizureOfConvenience" id="seizureOfConvenience" value="${this.financialPledge?.seizureOfConvenience}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">抵质押物与借款人相关性</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="relationOfMortgagor" id="relationOfMortgagor" value="${this.financialPledge?.relationOfMortgagor}"/>
                        </div>

                        <label class="col-md-2 control-label">法律有效性</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="legalValidity" id="legalValidity" value="${this.financialPledge?.legalValidity}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">初次认定价值</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="firstEvaluatePrice" id="firstEvaluatePrice" value="${this.financialPledge?.firstEvaluatePrice}"/>
                        </div>

                        <label class="col-md-2 control-label">最新认定价值</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="latestEvaluatePrice" id="latestEvaluatePrice" value="${this.financialPledge?.latestEvaluatePrice}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">最新认定日期</label>
                        <div class="col-md-3">
                            <g:datePicker class="form-control" name="latestEvaluateDate" value="${new Date()}" precision="day"/>
                        </div>

                        <label class="col-md-2 control-label">实际抵质押率</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="actualMortgageRate" id="actualMortgageRate" value="${this.financialPledge?.actualMortgageRate}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">抵质押率上限</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="mortgageRateUpperLimit" id="mortgageRateUpperLimit" value="${this.financialPledge?.mortgageRateUpperLimit}"/>
                        </div>

                        <label class="col-md-2 control-label">抵质押物说明</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="description" id="description" value="${this.financialPledge?.description}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">登记人</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="registerFullName" id="registerFullName" value="${this.financialPledge?.registerFullName}"/>
                        </div>

                        <label class="col-md-2 control-label">登记机构</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="registerAccount" id="registerAccount" value="${this.financialPledge?.registerAccount}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-2 control-label">登记日期</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="registerDate" id="registerDate" value="${this.financialPledge?.registerDate}"/>
                        </div>

                        <label class="col-md-2 control-label">更新日期</label>
                        <div class="col-md-3">
                            <g:textField class="form-control" type="text" name="registerUpdateDate" id="registerUpdateDate" value="${this.financialPledge?.registerUpdateDate}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <div class="col-md-3 col-md-offset-6">
                            <g:submitButton class="btn btn-info" name="create" value="保存"/>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</g:form>

</body>
</html>